//
//  MTGiftModel.swift
//  MT
//
//  Created by 陈悦 on 2020/5/19.
//  Copyright © 2020 张强. All rights reserved.
//

import Foundation
import ObjectMapper
import MTCategory

class MTGiftReportModel: Mappable {
    
    /// 请求是否成功的code
    var code: Int?
    /// 请求返回的Message
    var message: String?
    /// 分页对象
    var page: PageModel?
    /// 时间戳
    var timestamp: TimeInterval?
    
    var giftSum: Int?
    
    var result: [MTGiftReportSubModel]?
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        code    <- map["code"]
        message <- map["message"]
        page <- map["page"]
        timestamp <- map["timestamp"]
        result  <- map["result"]
        giftSum  <- map["giftSum"]
    }
}

open class PageModel: Mappable {
    
    public var curPage: Int?
    public var pageSize: Int?
    public var pages: Int?
    public var total: Int?
    
    required public init?(map: Map) {
        
    }
    
    open func mapping(map: Map) {
        curPage        <- map["curPage"]
        pageSize       <- map["pageSize"]
        pages       <- map["pages"]
        total     <- map["total"]
    }
}

class MTGiftReportSubModel: Mappable {
    
    var createTime: String?
    
    var price: Int = 0
    
    var nickname: String?
    
    var num: Int = 0
    
    var headerUrl: String?
    
    var levelId: Int = 0
    
    var status: Int = 0
    
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        createTime  <- map["createTime"]
        price       <- map["price"]
        nickname    <- map["nickname"]
        num         <- map["num"]
        headerUrl   <- map["headerUrl"]
        levelId     <- map["levelId"]
        status      <- map["status"]
    }
}

